package org.example.service.service;



import org.example.service.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class OrderService {
  @Autowired
  private RestTemplate restTemplate;
  public String getOrder() {
   String url = "http://userservice/user/getUser";
   System.out.println("url:"+url);
   User user = restTemplate.getForObject(url, User.class);
   System.out.println(user);
   return user.getName();

  }
}
